<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/admin/common/inc/incSession.jsp" %>
<jsp:include page="/admin/common/inc/Top.jsp" />
<%
	
	String srchEventType = util.getStr(request.getParameter("srchEventType"));
	String srchCategoryCode = util.getStr(request.getParameter("srchCategoryCode"));
	String srchCond 	= util.getStr(request.getParameter("srchCond")); 
	String srchContent 	= util.getStr(request.getParameter("srchContent"));
	String srchStdt 	= util.getStr(request.getParameter("srchStdt"));
	String srchEndt 	= util.getStr(request.getParameter("srchEndt"));
	String srchUseYn 	= util.getStr(request.getParameter("srchUseYn"));


	// paging
	String eventId 		= util.getStr(request.getParameter("eventId"));
	String idx 		= util.getStr(request.getParameter("idx"));
	String perRow 		= util.getStr(request.getParameter("perRow"));
	String startRow 	= util.getStr(request.getParameter("startRow"));
	String currentPage 	= util.getStr(request.getParameter("currentPage"));
	
	perRow = "".equals(perRow) ?"10":perRow;
	startRow = "".equals(startRow)?"0":startRow;
	currentPage = "".equals(currentPage)?"1":currentPage;
	
	
// 	param.put("srchCond",srchCond);
// 	param.put("srchContent",srchContent);
// 	param.put("srchStdt",srchStdt);
// 	param.put("srchEndt",srchEndt);
// 	param.put("srchUseYn",srchUseYn);
	
// 	paging
// 	param.put("perRow", perRow);
// 	param.put("startRow", startRow);
	
	
	
	//param.put("startRow",11);
	//param.put("perRow",10);
	
	param.put("eventId", eventId);	
	param.put("idx", idx);	
	HashMap map	 = 	(HashMap)sqlMap.queryForObject("AdminReview.selectEvenReviewtDetail",param);	//	실행할 SQL ID, 검색조건(없을경우 null)
	
%>
<script type="text/javascript">
	// 리스트 갯수
	var dispCnt = '${dispCnt}';
	
	$(document).ready(function() {

		//	등록
		$("#btnModify").click(function() {
			
			
			$("#description").val(Editor.getContent());
			$("#listForm").attr("action","/admin/event/eventDetail_u.jsp");
			$("#listForm").attr("target","hiddenFrame");		
			
			if( !confirm("이벤트를 수정 하시겠습니까?")) return;

			$("#listForm").submit();
			
		});
		
		
		//	초기값 셋팅
		$("#srchCond").val("<%=srchCond%>");
		$("#srchContent").val("<%=srchContent%>");
		$("#srchUseYn").val("<%=srchUseYn%>");
		$("#eventId").val("<%=eventId%>");
		
		
		$("#startRow").val("<%=startRow%>");
		$("#currentPage").val("<%=currentPage%>");
		
		
		/*
		$("#listForm").validate({
			rules: {
				eventType 	: "required",
				categoryCode: "required",
				eventName 	: "required",
				productName	: "required",
				recruitNo   : "required",
				link 		: "required",
				reqFdate 	: "required",
				reqTdate 	: "required",
				reviewFdate : "required",
				reviewTdate : "required",
				winDate 	: "required",
				provideDate : "required",
				useYn 		: "required"
			},
				
		  	messages: {
		  		eventType 	: "<br/>이벤트 타입을 선택하세요.",
				categoryCode: "<br/>카테고리를 선택하세요.",
				eventName 	: "<br/>이벤트명을 입력하세요.",
				productName	: "<br/>상품명을 입력하세요.",
				recruitNo   : "<br/>모집인원일 입력하세요.",
				link 		: "<br/>관련링크를 입력하세요.",
				reqFdate 	: "<br>이벤트 진행기간을 입력하세요.</br>",
				reqTdate 	: "<br>이벤트 진행기간을 입력하세요.</br>",
				reviewFdate : "<br>이벤트 활동기간을 입력하세요.</br>",
				reviewTdate : "<br>이벤트 활동기간을 입력하세요.</br>",
				winDate 	: "<br>당첨자 발표일을 입력하세요.</br>",
				provideDate : "<br>상품 지급일을 입력하세요.</br>",
				useYn 		: "<br/>사용 여부를 선택하세요."
		  },
		  
		  submitHandler: function (frm) {
              frm.submit(); // 통과시 전송
          },
          success: function (e) { 
              //
          }                

          
		});
		*/
		
		//	목록으로
		$("#btnList").click(function() {
			
			$("#listForm").attr("action","/admin/review/reviewList.jsp");
			$("#listForm").attr("target","_top");		
			$("#listForm").submit();
			
		});
		
	});
		
</script>	
	<body>
		<!-- header -->
		<div id="header">
			<jsp:include page="/admin/common/inc/Header.jsp" />
		</div>
		<!-- //header -->
		
		<!-- wrap -->
		<div id="wrap" >
		
			<!-- contentWrap -->
			<div id="contentWrap" >
			
				<!-- topmenu -->
				<jsp:include page="/admin/common/inc/TopMenu.jsp" />
				<!-- //topmenu -->
				
				
				<div id="conts">
				
					<div class="main_view clfix " style="height: 800px;">
						<!-- content -->
						
						
						<form id="listForm" name="listForm" method="post">
						<input type="hidden" name="srchCond" id="srchCond" value="" />
						<input type="hidden" name="srchContent" id="srchContent" value="" />
						<input type="hidden" name="eventId" id="eventId" value="" />
						<input type="hidden" name="startRow" id="startRow" value="" />
						<input type="hidden" name="currentPage" id="currentPage" value="" />
						
						<div class="section_main">
							
							<!--btn-->
<!-- 							<div class="al_right mb20"> -->
<!-- 								<button type="button" id="btnModify">수정</button> -->
<!-- 							</div> -->
							<!--//btn-->
							
							<!--board input-->
							<table class="bdc_input mb10" id="eventInfo">
								<colgroup><col width="20%"><col width="30%"><col width="20%"><col width="30%"></colgroup>
<!-- 								<tr> -->
<!-- 									<th class="cth">썸네일</th> -->
<%-- 									<td class="ctd" colspan="3"><%=util.getStr(map.get("THUMB_IMG")) %></td> --%>
<!-- 								</tr> -->
								<tr>
									<th class="cth">제목</th>
									<td class="ctd" colspan="3"><%=util.getStr(map.get("REVIEW_TITLE")) %></td>
								</tr>
								<tr>
									<th class="cth">등록자</th>
									<td class="ctd" colspan="3"><%=util.getStr(map.get("MEMBER_ID")) %></td>
								</tr>
								<tr>
									<th class="cth">리뷰 등록일</th>
									<td class="ctd"><%=util.getStr(map.get("REG_DATE")) %></td>
									<th class="cth">조회수</th>
									<td class="ctd"><%=util.getStr(map.get("RCM_CNT")) %></td>
								</tr>
								<tr>
									<th class="cth">Blor URL</th>
									<td class="ctd" colspan="3"><a href="<%=util.getStr(map.get("BLOG_URL")) %>" target="_blank"><%=util.getStr(map.get("BLOG_URL")) %></a></td>
								</tr>
								<tr>
									<th class="cth">내용</th>
									<td class="ctd" colspan="3"><textarea style="width: 98%; height: 400px;" readonly="readonly" ><%=util.getStr(map.get("CONTENT")) %></textarea></td>
								</tr>
							</table>
							
						</div>
						
						<!--//board list-->						
						</form>
						
						<!-- //content -->
						
					</div>
					<!--btn-->
					<div class="al_right mb35">
						<button type="button" id="btnList">목록으로</button>
					</div>
					<!--//btn-->
					
				</div>
				
			</div>
			<!-- //contentWrap -->
			
		</div>
		<%@ include file="/admin/common/inc/Footer.jsp" %>
		
		
		<!-- //wrap -->
		
		
	
	</body>
</html>